import request from "@/utils/request";
import type { DictSuperiorListType } from "./types";

/**
 * 请求根据上级id获取子节点数据列表
 * @param parentId
 * @returns
 */
export const reqDictSuperiortList = (parentId: number) => {
  return request.get<null, DictSuperiorListType>(
    `/admin/cmn/dict/findByParentId/${parentId}`
  );
};

/**
 * 请求根据dictCode获取下级子节点
 * @param dictCode
 * @returns
 */
export const reqDictLowerList = (dictCode: string) => {
  return request.get<null, DictSuperiorListType>(
    `/admin/cmn/dict/findByDictCode/${dictCode}`
  );
};
